<div class="easyui-tabs" data-options="fit:true,border:false,plain:true">
    <div title="基本设置" style="padding:10px">
    	<form id="personal_site_info_form" method="post">
    	<!--基本设置!-->
        <table cellpadding="5" style="width:100%;">
            <tr>
                <th align="right" style="width:100px;"> 用 户 名：</th>
              	<td><?php echo @$this->session->userdata('user_name'); ?></td>
            </tr>
            <tr>
                <th align="right">真实姓名：</th>
              	<td><input class="easyui-textbox" data-options="required:true,validType:'length[1,20]'" missingMessage="输入您的真实姓名" style="width:200px;" name='personal_user_actual'  id="personal_user_actual" /></td>
            </tr>
            <tr>
                <th align="right">别名：</th>
              	<td><input class="easyui-textbox" validType="length[1,20]" style="width:200px;" name='personal_user_aliases'  id="personal_user_aliases"/></td>
            </tr>
            <tr>
                <th align="right">性别：</th>
              	<td><input type="radio" id="personal_user_sex_0" name="personal_user_sex" value="0"><label for="personal_user_sex_0">男</label>
            		<input type="radio" id="personal_user_sex_1" name="personal_user_sex" value="1"><label for="personal_user_sex_1">女</label>
                </td>
            </tr>
            <tr>
                <th align="right">出生日期：</th>
              	<td><input class="easyui-datebox" editable="false" style="width:200px;" name='personal_user_birthday' id="personal_user_birthday"/></td>
            </tr>
            <tr>
                <th align="right">电子邮件：</th>
              	<td><input class="easyui-textbox" invalidMessage="请填写正确的邮件格式" style="width:200px;" name='personal_user_email' id="personal_user_email" /></td>
            </tr>
            <tr>
                <th align="right">移动电话：</th>
              	<td><input class="easyui-numberbox" validType="length[1,11]" invalidMessage="请填写正确的手机格式:11位" style="width:200px;" name='personal_user_mobile' id="personal_user_mobile"/></td>
            </tr>
            <tr>
                <th align="right">固定电话：</th>
              	<td><input class="easyui-numberbox" validType="length[1,20]" invalidMessage="请填写正确的固定电话格式"  style="width:200px;" name='personal_user_tel' id="personal_user_tel"/></td>
            </tr>
            <tr>
                <th align="right">ＱＱ号：</th>
              	<td><input class="easyui-numberbox" validType="length[1,20]" style="width:200px;" name='personal_user_qq' id="personal_user_qq"/></td>
            </tr>
            <tr>
            	<td colspan="2"><div class="menu-sep" style="margin: 3px 0px 3px 3px;"></div></td>
            </tr>
            <tr>
                <td colspan="2"><a href="javascript:void(0)" onclick="personal_site_info()" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存基本设置</a></td>
            </tr>
        </table>
        </form>
    </div>
    <div title="修改密码" style="padding:5px">
    	<form id="personal_site_pwd_form" method="post">
        <table cellpadding="5" style="width:100%;">
            <thead>
                <tr>
                	<th align="right" style="width:150px;">用户名：</th>
              		<td><?php echo @$this->session->userdata('user_name'); ?></td>
            	</tr>
				<tr>
                	<th align="right">原密码：</th>
              		<td><input class="easyui-textbox" type="text" data-options="required:true,validType:'length[1,32]'" missingMessage="输入旧密码" style="width:200px;" name='personal_pwd_old'  id="personal_pwd_old"/></td>
            	</tr>
				<tr>
                	<th align="right">新密码：</th>
              		<td><input class="easyui-textbox" type="password" data-options="required:true,validType:'length[1,32]'" missingMessage="输入新密码" style="width:200px;" name='personal_pwd_new'  id="personal_pwd_new"/></td>
            	</tr>
                <tr>
                	<th align="right">确认密码：</th>
              		<td><input class="easyui-textbox" type="password" data-options="required:true" validType="equals['#personal_pwd_new']" missingMessage="再次输入新密码" style="width:200px;" name='personal_pwd_r'  id="personal_pwd_r"/></td>
            	</tr>
                <tr>
                    <td colspan="2"><div class="menu-sep" style="margin: 3px 0px 3px 3px;"></div></td>
                </tr>
				<tr>
					<td colspan="2"><a href="javascript:void(0)" onclick="personal_site_pwd()" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存密码修改</a></td>
				</tr>
            </thead>
        </table>
        </form>
    </div>
</div>
<script>
//表单日期格式


//两次输入密码验证
$.extend($.fn.validatebox.defaults.rules, {
    equals: {
        validator: function(value,param){
            return value == $(param[0]).val();
        },
        message: '两次输入不匹配.'
    }
});

//修改基本设置
function personal_site_info(){
	$('#personal_site_info_form').form('submit', {
		url:'<?php echo base_url()?>systemmanage/personal_info',
		onSubmit: function(){
			return $(this).form('enableValidation').form('validate');
		},
		success:function(result){
			var result = eval('('+result+')');
			if(result.success == true){
				$.messager.alert('提示','修改成功，重新登录后生效!','info');	
			}else{
				$.messager.alert('警告',result.errorMsg,'warning');	
			}
		}
	});
}

//修改密码
function personal_site_pwd(){
	$('#personal_site_pwd_form').form('submit', {
		url:'<?php echo base_url()?>systemmanage/set_personal_user_pwd',
		onSubmit: function(){
			//return $(this).form('validate');
			return $(this).form('enableValidation').form('validate');
		},
		success:function(result){
			var result = eval('('+result+')');
			if(result.success == true){
				$.messager.alert('提示','修改成功，重新登录后生效!','info');	
			}else{
				$.messager.alert('警告',result.errorMsg,'warning');	
			}
		}
	});
}

//填充数据到表单
$('#personal_site_info_form').form('load',{
	personal_user_actual:'<?php echo @$user_info[0]->user_actual; ?>',
	personal_user_aliases:'<?php echo @$user_info[0]->user_aliases; ?>',
	personal_user_sex:'<?php echo @$user_info[0]->user_sex; ?>',
	personal_user_birthday:'<?php if(@$user_info[0]->user_birthday == 0)echo ''; else echo @$user_info[0]->user_birthday?>',
	personal_user_email:'<?php echo @$user_info[0]->user_email; ?>',
	personal_user_mobile:'<?php echo @$user_info[0]->user_mobile; ?>',
	personal_user_tel:'<?php echo @$user_info[0]->user_tel; ?>',
	personal_user_qq:'<?php echo @$user_info[0]->user_qq; ?>'
});
</script>